<template>
	<view class="comparison-card">
		<view class="card-header">
			<text class="card-title">均分对比</text>
			<view class="info-icon">ⓘ</view>
		</view>
		
		<view class="comparison-table">
			<view class="table-header">
				<text class="header-cell">班级</text>
				<text class="header-cell">最高分</text>
				<text class="header-cell">平均分</text>
				<text class="header-cell">最高分</text>
				<text class="header-cell">最低分</text>
			</view>
			
			<view class="table-row" v-for="classData in comparisonData" :key="classData.class">
				<text class="table-cell">{{ classData.class }}</text>
				<text class="table-cell highlight-score">{{ classData.highest }}</text>
				<text class="table-cell">{{ classData.average }}</text>
				<text class="table-cell">{{ classData.max }}</text>
				<text class="table-cell">{{ classData.min }}</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'ScoreComparison',
	props: {
		comparisonData: {
			type: Array,
			default: () => [
				{ class: '2208班', highest: '146.7', average: '500', max: '500', min: '39' },
				{ class: '2201班', highest: '15.3', average: '500', max: '500', min: '39' },
				{ class: '2208班', highest: '146.7', average: '500', max: '500', min: '39' },
				{ class: '2201班', highest: '15.3', average: '500', max: '500', min: '39' },
				{ class: '2208班', highest: '146.7', average: '500', max: '500', min: '39' }
			]
		}
	}
}
</script>

<style lang="less" scoped>
@primary-color: #4DD0E1;
@secondary-color: #81C784;
@text-color: #333;
@text-light: #666;
@white: #fff;
@border-color: #f0f0f0;

.comparison-card {
	background: @white;
	border-radius: 16rpx;
	padding: 24rpx;
	margin-bottom: 20rpx;
	box-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.08);

	.card-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20rpx;

		.card-title {
			font-size: 28rpx;
			font-weight: bold;
			color: @text-color;
		}

		.info-icon {
			width: 32rpx;
			height: 32rpx;
			border-radius: 50%;
			background: #e0e0e0;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 18rpx;
			color: @text-light;
		}
	}

	.comparison-table {
		width: 100%;

		.table-header {
			display: flex;
			background: #f1f3f4;
			padding: 16rpx 0;
			border-radius: 8rpx 8rpx 0 0;
			margin-bottom: 8rpx;

			.header-cell {
				flex: 1;
				text-align: center;
				font-size: 22rpx;
				font-weight: bold;
				color: @text-light;
			}
		}

		.table-row {
			display: flex;
			padding: 16rpx 0;
			border-bottom: 1rpx solid @border-color;

			&:last-child {
				border-bottom: none;
			}

			.table-cell {
				flex: 1;
				text-align: center;
				font-size: 24rpx;
				color: @text-color;

				&.highlight-score {
					color: #FF5722;
					font-weight: bold;
				}
			}
		}
	}
}
</style>
